//
//  TJNetWorkTool.m
//  TJSinaWeiBo_OC
//
//  Created by 唐后能 on 16/4/19.
//  Copyright © 2016年 itheima. All rights reserved.
//

#import "TJNetWorkTool.h"

@implementation TJNetWorkTool
// 获取全局共享单例.
+(instancetype)shareNetWorkTool{

    static TJNetWorkTool* instance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        // 创建baseURL.
        NSURL *baseURL = [NSURL URLWithString:@"https://api.weibo.com/"];
        instance = [[self alloc] initWithBaseURL:baseURL];
        // 添加html的序列化器
        instance.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html",@"text/plain",nil];
    });
    return instance;
}
@end
